The meditative response in which he performs them gives him that vital loosening and equability of all his powers, that collectedness and presence of mind, without which no right work can be done.
But Leonov had the presence of mind to find a solution. Presence of mind means being able to react quickly and stay calm in a difficult or dangerous situation.